#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <cv.h>
#include "Quadtree.h"
#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
private slots:
    void hitOrMiss(IplImage *src, IplImage *dst, IplImage* kernel);

    void skeleton(IplImage *source, IplImage *destiny, IplConvKernel* kernel, int x, int y);

    int* cvMatToInt(CvMat *src);
    int* IplImageToInt(IplImage *src);


    void prewittFilter(IplImage *source, IplImage *destiny);

    void splitAndMergeSegmentation(IplImage *source, IplImage *destiny);


    void on_button_Adelgazamiento_clicked();

    void on_button_Esqueleto_clicked();

    void on_button_Previous_clicked();

    void on_button_Next_clicked();

    void on_button_CerrarEsqueleto_clicked();

    void on_prewittButton_clicked();

    void on_splitAndMergeButton_clicked();

    void llenarQuadtree(IplImage *source, Quadtree *arbol,int nivel);
    void ThinSubiteration2(CvMat *pSrc, CvMat *pDst);
    void ThinSubiteration1(CvMat *pSrc, CvMat *pDst);
    void MorphologicalThinning(CvMat *pSrc, CvMat *pDst);
private:
    Ui::MainWindow *ui;

};

#endif // MAINWINDOW_H
